const db = uniCloud.database();

exports.main = async (event, context) => {
  try {
    const { id } = event;
    
    // 参数验证
    if (!id) {
      return {
        success: false,
        message: '缺少必要参数：id'
      };
    }
    
    // 查询反馈详情
    const result = await db.collection('feedbacks').doc(id).get();
    
    return {
      success: true,
      data: result.data
    };
  } catch (error) {
    console.error('获取反馈详情失败:', error);
    return {
      success: false,
      message: '获取反馈详情失败',
      errorDetail: error.message || String(error)
    };
  }
};